package com.lemurian.bankdata.servicebean;

import java.util.List;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.lemurian.bankdata.bean.ClientCertificateDAO;
import com.lemurian.bankdata.lite.struts.PartialList;
import com.lemurian.bankdata.services.ClientCertificateService;
import com.lemurian.entity.Client;
import com.lemurian.entity.ClientCertificate;

@Service("clientCertificateService")
@Transactional(readOnly=true)
public class ClientCertificateBean implements ClientCertificateService {
	
	@Autowired private ClientCertificateDAO dao;
	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void delete(ClientCertificate entity) {
		dao.delete(entity);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void delete(int id) {
		dao.delete(id);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public int delete(String sql) {
		return dao.delete(sql);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<ClientCertificate> findAll() {
		return dao.findAll();
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<ClientCertificate> findAll(Order order) {
		return dao.findAll(order);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public List<ClientCertificate> findByCriteria(Order order, Criterion... criterion) {
		return dao.findByCriteria(order, criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public PartialList<ClientCertificate> findByCriteria(int start, int count, Order order, Criterion... criterion) {
		return dao.findByCriteria(start, count, order, criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public ClientCertificate findByCriteria(Criterion... criterion) {
		return dao.findByCriteria(criterion);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public ClientCertificate findById(int id) {
		return dao.findById(id);
	}

	@Override
	@Transactional(readOnly=true,propagation=Propagation.REQUIRED)
	public ClientCertificate load(int id) {
		return dao.load(id);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public ClientCertificate save(ClientCertificate entity) {
		return dao.save(entity);
	}

	@Override
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public ClientCertificate update(ClientCertificate entity) {
		return dao.update(entity);
	}

	@Override
	public List<ClientCertificate> getByClientId(Client client) {
		return dao.getByClientId(client);
	}

}